import React, { Component } from 'react';
import { NavBar } from 'antd-mobile';
import { bindActionCreators } from 'redux';
import { goBack } from '../redux/actions/global';
import { connect } from 'react-redux';

class Demo6 extends Component {
  render() {
    const { goBack, match } = this.props;
    // console.log('this.props',this.props);
    return (
      <div className="page">
        <NavBar
          leftContent={[
            <span key='1' className="iconfont icon-left"></span>
          ]}
          onLeftClick={goBack}
        >Demo6</NavBar>
        <div className="content demo5">
          {match.params.name}
        </div>
      </div>
    );
  }
}


const mapStateToProps = (state) => {
  return {
    lists: state.lists,
  }
}
// redux 绑定dispath
const mapDispatchToProps = (dispatch) => {
  return {
    goBack: bindActionCreators(goBack, dispatch)
  }
}

Demo6 = connect(mapStateToProps, mapDispatchToProps)(Demo6)

export default Demo6;
